﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Option.Master" AutoEventWireup="true"
    CodeBehind="Option.aspx.cs" Inherits="MsgCenter.Web.Pages.UserGroup.Option" %>

<asp:Content ID="Content1" ContentPlaceHolderID="headContent" runat="server">
    <script type="text/javascript" src="<%=ResolveClientUrl("~/JavaScript/FirePlat/assets/js/ace.min.js") %>"></script>
    <script type="text/javascript" src="<%=ResolveClientUrl("~/JavaScript/FirePlat/assets/js/ace-extra.min.js") %>"></script>
    <script type="text/javascript" src="<%=ResolveClientUrl("~/JavaScript/FirePlat/assets/js/bootstrap.min.js") %>"></script>
    <script type="text/javascript" src="<%=ResolveClientUrl("~/JavaScript/FirePlat/assets/js/ace-elements.min.js") %>"></script>
    <script type="text/javascript" src="<%=ResolveClientUrl("~/JavaScript/FirePlat/assets/js/jqGrid/i18n/grid.locale-cn.js") %>"></script>
    <script type="text/javascript" src="<%=ResolveClientUrl("~/JavaScript/FirePlat/assets/js/jqGrid/jquery.jqGrid.min.js") %>"></script>
    <script type="text/javascript" src="<%=ResolveClientUrl("~/JavaScript/FirePlat/assets/js/jqGrid/myJqgrid.js") %>"></script>
    <script type="text/javascript">
        var txtName_ID = "<%=txtName.ClientID %>";
        //******************************** 校验必填项 ********************************
        function CheckSubmit() {
            var CheckResult = CheckValue();
            if (CheckResult == 'success') {
                return true;
            }
            else {
                showDialogMessage(CheckResult);
                return false;
            }
        }
        function CheckValue() {
            if ($('#' + txtName_ID).val() == "") {
                $('#' + txtName_ID).focus();
                return "分组名称必须填写！";
            }
            return "success";
        }
        //******************************** 校验必填项 ********************************
        //******************************** 提示信息 ********************************
        function AlertMessage(message) { alert(message); }
        function Close_Reload() {
            window.parent.CBClose_Load();
        }

        var gridTableID = 'grid-table';
        var ajaxUrl = "../../Handlers/Handler_UserGroup.ashx";
        jQuery(function ($) {
            $("#divUser").hide();
            if ("<%=strType %>" == "Look") {
                $("#divUser").show();
                var url = ajaxUrl + "?method=GetGroupUserList&GroupID=<%=strGuID %>";
                var colNames = ['UserID', '用户名称', '所属部门'];
                var colModel = [
				    { name: 'UserID', index: 'UserID', width: 50, editable: false, hidden: true },
				    { name: 'Name', index: 'Name', width: 12, editable: false, stype: 'text', searchoptions: { sopt: ['eq', 'ne', 'cn', 'nc']} },
				    { name: 'DeptName', index: 'DeptName', width: 30, editable: false, stype: 'text', searchoptions: { sopt: ['eq', 'ne', 'cn', 'nc']} }
			    ];
                var dfop =
                {
                    rownumbers:true,
                    IsMultiSelect: false,
                    GridID: gridTableID,
                    GridPagerID: null,
                    Url: url,
                    ColNames: colNames,
                    ColModel: colModel,
                    Caption: "用户列表",
                    SortName: "CreateDate",
                    Height: 180,
                    RowNum: 1000
                };
                showJqGrid(dfop);
            }
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="mailContent" runat="server">
    <table width="660px" cellpadding="0" cellspacing="0">
        <tr>
            <td width="120px" align="right" height="35px">
                <font color="red">*</font>&nbsp;分组名称:
            </td>
            <td width="240px" align="left">
                <input type="text" id="txtName" runat="server" placeholder="" class="form-control col-xs-10 col-sm-5"
                    style="width: 200px" />
            </td>
            <td width="120px" align="right">
                &nbsp;
            </td>
            <td width="140px" align="left">
                &nbsp;<span class="lbl"></span>
            </td>
        </tr>
        <tr>
            <td width="80px" align="right" height="35px">
                分组描述:
            </td>
            <td align="left" colspan="3">
                <asp:TextBox ID="txtDes" runat="server" Height="50px" TextMode="MultiLine" CssClass="form-control col-xs-10 col-sm-5"
                    Width="85%"></asp:TextBox>
            </td>
        </tr>
    </table>
    <div class="center" id="divUser">
        <div class="row">
            <div class="col-xs-12">
                <div class="row">
                    <div class="col-xs-12">
                        <div class="widget-body">
                            <table id="grid-table">
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <br />
    <br />
    <div style="text-align: center">
        <asp:LinkButton ID="linkSave" runat="server" CssClass="btn btn-info" OnClientClick="return CheckSubmit();"
            OnClick="linkSave_Click" Visible="false"><i class="icon-ok bigger-110"></i>保存</asp:LinkButton>
        &nbsp;&nbsp;
        <button class="btn" onclick="window.parent.CBClose();return false;">
            <i class="icon-undo bigger-110"></i>取消
        </button>
    </div>
</asp:Content>
